cc.Class({
    extends: cc.Component,

    properties: {
        times: 0,//控制时间
        // foo: {
        //    default: null,      // The default value will be used only when the component attaching
        //                           to a node for the first time
        //    url: cc.Texture2D,  // optional, default is typeof default
        //    serializable: true, // optional, default is true
        //    visible: true,      // optional, default is true
        //    displayName: 'Foo', // optional
        //    readonly: false,    // optional, default is false
        // },
        // ...
    },

    // use this for initialization
    onLoad: function () {
        this.moveRight();
    },
//左右移动
    moveRight: function(){
        var seq = cc.repeatForever(
             cc.sequence(
                 cc.moveBy(this.times, cc.p(240, 0)), cc.moveBy(this.times, cc.p(-240,0))
             ));
        this.node.runAction(seq);
    },


    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});
